def convert(val):
    if val>='0' and val<='9':
        return ord(val)-ord('0')
    else:
        return 10+ord(val)-ord('a')

def reConvert(val):
    if val<10:
        return str(val)
    else:
        return chr(ord('a')+val-10)

def add_36(a,b):
    i=0
    n=len(a)-1
    m=len(b)-1
    plus=0
    ret=""
    while i<=n or i<=m or plus!=0:
        temp=0
        if i<=n:
            temp+=convert(a[n-i])
        if i<=m:
            temp+=convert(b[m-i])
        temp+=plus
        ret=reConvert(temp%36)+ret
        plus=temp//36
        i+=1
    return ret


print(add_36("1","zzz"))


def f1():
    while True:
        a=f()
        b=f()
        if a!=b:
            return a
